<?php
class modules extends db_table {
	/**
	 * Installed module ID
	 *
	 * @var db_field
	 */
	public $module_id;
	/**
	 * Installed module name
	 *
	 * @var db_field
	 */
	public $module_name;
	/**
	 * Module installation date
	 *
	 * @var db_field
	 */
	public $module_inst_date;
	/**
	 * Module state (active or suspended)
	 *
	 * @var db_field
	 */
	public $module_state;

	/**
	 * Constructor
	 *
	 * @param mixed $id
	 */
	public function __construct($id = null) {
		parent::__construct($id);
	}
	
	/**
	 * Sets module state field to active
	 *
	 */
	public function set_active() {
		$this->module_state->set_value("active");
	}
	
	/**
	 * Sets module state field to syspended
	 *
	 */
	public function set_suspended() {
		$this->module_state->set_value("suspended");
	}
	
	/**
	 * Gets if module is active
	 *
	 * @return bool
	 */
	public function is_active() {
		return ($this->module_state->get_value() == "active");
	}
}
?>